package battleGame;

import battleGame.WarriorAction.Action;

public abstract class WarriorActionFactory 
{
	static public WarriorAction attackSword( Warrior myWarrior, Warrior warriorToDamage )
	{
		WarriorAction warriorAction = new WarriorAction();
		warriorAction.action = WarriorAction.Action.ATTACKSWORD;
		warriorAction.warrior = myWarrior;
		warriorAction.target = warriorToDamage;
		return warriorAction;
	}
	
	static public WarriorAction attackArrow( Warrior myWarrior, Warrior warriorToDamage )
	{
		WarriorAction warriorAction = new WarriorAction();
		warriorAction.action = WarriorAction.Action.ATTACKARROW;
		warriorAction.warrior = myWarrior;
		warriorAction.target = warriorToDamage;
		return warriorAction;
	}
	
	static public WarriorAction move( Warrior myWarrior, Vector2 movingToPoint )
	{
		WarriorAction warriorAction = new WarriorAction();
		warriorAction.action = WarriorAction.Action.MOVE;
		warriorAction.warrior = myWarrior;
		warriorAction.point = movingToPoint;
		return warriorAction;
	}
	
	static public WarriorAction rotate( Warrior myWarrior, double angle )
	{
		WarriorAction warriorAction = new WarriorAction();
		warriorAction.action = WarriorAction.Action.ROTATE;
		warriorAction.warrior = myWarrior;
		warriorAction.point = new Vector2( angle, 0 );
		return warriorAction;
	}
	
	static public WarriorAction waiting()
	{
		WarriorAction warriorAction = new WarriorAction();
		warriorAction.action = WarriorAction.Action.WAIT;
		return warriorAction;
	}
	
	static public WarriorAction flee()
	{
		WarriorAction warriorAction = new WarriorAction();
		warriorAction.action = WarriorAction.Action.FLEE;
		return warriorAction;		
	}
	
	static public WarriorAction defend()
	{
		WarriorAction warriorAction = new WarriorAction();
		warriorAction.action = WarriorAction.Action.DEFEND;
		return warriorAction;		
	}	
}

/*
//ATTACKSWORD is using warrior and point (a radius will be applied to the attack, simulating with a circle the sword attack range)
//ATTACKARROW is using warrior and target (the arrow is applied directly to the target warrior, calculating the damage with the distance)
//MOVE is using warrior and point
//ROTATE is using warrior and point.x (as the angle)
enum Action{ ATTACKSWORD, ATTACKARROW, MOVE, ROTATE, WAIT, FLEE, DEFEND, MAX };

Action action;
Warrior warrior;
Vector2 point;
Warrior target;
*/